<?php

namespace App\Services\FaceRecognition\Drivers;

use App\Services\FaceRecognition\FaceRecognitionResult;
use App\Services\FaceRecognition\FaceRecognitionVerifier;
use Illuminate\Support\Facades\Log;

class LogFaceRecognitionVerifier implements FaceRecognitionVerifier
{
    protected array $config;

    public function __construct(array $config = [])
    {
        $this->config = $config;
    }

    public function start(array $params): FaceRecognitionResult
    {
        Log::info('[FaceRecognition][Log] mock start', [
            'params' => $params,
        ]);

        $mockData = [
            'orderNo' => $params['orderNo'] ?? uniqid('FACE_'),
            'url' => 'https://example.com/face-auth',
            'expireTime' => now()->addMinutes(10)->toDateTimeString(),
        ];

        return FaceRecognitionResult::success($mockData, '模拟人脸核验链接返回', [
            'mock' => true,
        ]);
    }
}
